package com.palm.hubo2o.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.widget.ImageView;

import com.palm.hubo2o.BaseActivity;
import com.palm.hubo2o.R;

import butterknife.Bind;

/**
 * Created by dest1 on 2015/9/16.
 */
public class IndexActivity extends BaseActivity {
    @Bind(R.id.img_index)
    ImageView launcher;
    CountDownTimer timer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_index);
//        AppConfig.init(this);
    }

    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        timer = new CountDownTimer(3000, 3000) {
            @Override
            public void onTick(long millisUntilFinished) {

            }

            @Override
            public void onFinish() {
                startActivity(new Intent(IndexActivity.this, MainActivity.class));
                finish();
            }
        }.start();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (timer != null)
            timer.cancel();
    }
}
